<template>
  <div class="app-container">
    <h1>果园产量分析</h1>
    <el-table :data="yieldAnalysis" style="width: 100%">
      <el-table-column prop="year" label="年份"></el-table-column>
      <el-table-column prop="totalYield" label="总产量"></el-table-column>
      <el-table-column prop="farmingActivities" label="主要农事活动">
        <template slot-scope="scope">
          <ul>
            <li v-for="(activity, index) in scope.row.farmingActivities" :key="index">{{ activity }}</li>
          </ul>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      yieldAnalysis: [
        { year: 2023, totalYield: 1000, farmingActivities: ['打药', '除草', '施肥'] },
        { year: 2024, totalYield: 1200, farmingActivities: ['打药', '施肥', '灌溉'] }
      ]
    };
  }
};
</script>

<style scoped>
.app-container {
  padding: 20px;
}

ul {
  list-style-type: none;
  padding: 0;
}

li {
  margin-bottom: 5px;
}
</style>



